Skip to content

Conversation

@deads2k
Copy link
Contributor

@deads2k deads2k commented Feb 13, 2023

For openshift/enhancements#1373

Part 1 of a multi-step plan to make individual featuregates observable via the API. This was previously avoided because when featuregates get promoted from TechPreview to Default, during an upgrade, an old operator may try to enable a TechPreview variant of a feature.

This can be addressed by keying the featuregates by version. Let's see how ugly that will be in practice now that we have a decent build-out of library-go.

/hold

This is proving the concept, not to be merged until it shows as working end-to-end.

Other steps include

  1. cluster-config-operator (upgrades first) writing the new featuregate
  2. library-go mechanism to wait for featuregate determination (stopCh likely)
  3. library-go mechanism to detect featuregate change (stopCh likely, handler likely, update channel a possibility)
  4. library-go easy "get featuregates" function
  5. enhancements write up describing how it works end to end.

@openshift-ci openshift-ci bot added do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. labels Feb 13, 2023
@openshift-ci
Copy link
Contributor

openshift-ci bot commented Feb 13, 2023

Hello @deads2k! Some important instructions when contributing to openshift/api:
API design plays an important part in the user experience of OpenShift and as such API PRs are subject to a high level of scrutiny to ensure they follow our best practices. If you haven't already done so, please review the OpenShift API Conventions and ensure that your proposed changes are compliant. Following these conventions will help expedite the api review process for your PR.

@openshift-ci openshift-ci bot requested review from bparees and mfojtik February 13, 2023 22:10
@openshift-ci openshift-ci bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Feb 13, 2023
@deads2k deads2k changed the title [wip] add featuregate status add featuregate status Mar 28, 2023
@openshift-ci openshift-ci bot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Mar 28, 2023

type FeatureGateAttributes struct {
// name is the name of the FeatureGate
// +kubebuilder:validation:Pattern=`^([A-Za-z0-9-]+\.)*[A-Za-z0-9-]+\.?$`
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since this will be synced from the spec in a CustomNoUpgrade scenario, do we have the same validation on the spec for that? How do we validate that the OpenShift default feature gates for each set adhere to this?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All known featuregates follow this pattern. Because of that, no existing cluster can have set value that doesn't match and had that value work. Because of that, I'll update the customnoupgrade validation in this PR.

// name is the name of the FeatureGate
// +kubebuilder:validation:Pattern=`^([A-Za-z0-9-]+\.)*[A-Za-z0-9-]+\.?$`
// +kubebuilder:validation:Required
// +required
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need +required or does the kubebuilder version suffice? Is there a tool that does not understand the kubebuilder tag? (I know kubeubilder doesn't understand +required)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

removing it appeared to have no impact

Comment on lines 99 to 111
// enabled is a list of all feature gates that are enabled in the cluster for the named version
// +optional
Enabled []FeatureGateAttributes `json:"enabled"`
// disabled is a list of all feature gates that are disabled in the cluster for the named version
// +optional
Disabled []FeatureGateAttributes `json:"disabled"`
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
// enabled is a list of all feature gates that are enabled in the cluster for the named version
// +optional
Enabled []FeatureGateAttributes `json:"enabled"`
// disabled is a list of all feature gates that are disabled in the cluster for the named version
// +optional
Disabled []FeatureGateAttributes `json:"disabled"`
// enabled is a list of all feature gates that are enabled in the cluster for the named version.
// +optional
Enabled []FeatureGateAttributes `json:"enabled"`
// disabled is a list of all feature gates that are disabled in the cluster for the named version.
// +optional
Disabled []FeatureGateAttributes `json:"disabled"`

Nit, other godocs here are punctuated

}

type FeatureGateAttributes struct {
// name is the name of the FeatureGate
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
// name is the name of the FeatureGate
// name is the name of the FeatureGate.

deads2k added 2 commits April 24, 2023 11:01
All valid featuregates follow this pattern today. This means that anyone
setting a value that doesn't match the pattern would have gotten a
cluster that didn't work and those people couldn't upgrade anyway, so
adding this validation is acceptable.
@deads2k deads2k force-pushed the make-tech-preview-great branch from d24a78b to 5838758 Compare April 24, 2023 15:01
@openshift-ci openshift-ci bot added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Apr 24, 2023
@openshift-ci
Copy link
Contributor

openshift-ci bot commented Apr 24, 2023

@deads2k: all tests passed!

Full PR test history. Your PR dashboard.

Details

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. I understand the commands that are listed here.

@JoelSpeed
Copy link
Contributor

/approve
/lgtm

Hold cancel at your will

@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Apr 24, 2023
@openshift-ci
Copy link
Contributor

openshift-ci bot commented Apr 24, 2023

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: deads2k, JoelSpeed

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@deads2k
Copy link
Contributor Author

deads2k commented Apr 24, 2023

confirmed with staff eng we will do this to free up the ccm payload problem.

@deads2k
Copy link
Contributor Author

deads2k commented Apr 24, 2023

/hold cancel

@openshift-ci openshift-ci bot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Apr 24, 2023
@openshift-ci openshift-ci bot merged commit e83c8e9 into openshift:master Apr 24, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved Indicates a PR has been approved by an approver from all required OWNERS files. lgtm Indicates that a PR is ready to be merged. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants